package com.linln.modules.member.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.linln.modules.member.domain.AreaCount;
import com.linln.modules.member.repository.AreaCountRepository;
import com.linln.modules.member.service.AreaCountService;

/**
 * @author hct
 * @date 2019/09/12
 */
@Service
public class AreaCountServiceImpl implements AreaCountService {

    @Autowired
    private AreaCountRepository areaCountRepository;

    /**
     * 根据ID查询数据
     * @param id 主键ID
     */
    @Override
    @Transactional
    public AreaCount getById(Long id) {
        return areaCountRepository.findById(id).orElse(null);
    }

    /**
     * 根据ID查询数据
     * @param id 主键ID
     */
    @Override
    public AreaCount findByArea(String area) {
        return areaCountRepository.findByArea(area);
    }


    /**
     * 保存数据
     * @param messageTop 实体对象
     */
    @Override
    public AreaCount save(AreaCount messageTop) {
        return areaCountRepository.save(messageTop);
    }

    public int updateReadNumByArea(String area) {
    	return areaCountRepository.updateReadNumByArea(area);
    }
	
    public int updateFabuByArea(String area) {
    	return areaCountRepository.updateFabuByArea(area);
    }
	
    
    public int updateShareByArea(String area) {
    	return areaCountRepository.updateShareByArea(area);
    }
	public int updateCollectByArea(String area) {
		return areaCountRepository.updateCollectByArea(area);
	}

    
    public int updateStoreFabuByArea(String area) {
    	return areaCountRepository.updateStoreFabuByArea(area);
    }
	
    public int updateStoreReadByArea(String area) {
    	return areaCountRepository.updateStoreReadByArea(area);
    }
	
    public int updateStoreShareByArea(String area) {
    	return areaCountRepository.updateStoreShareByArea(area);
    }
	
    
    public int updateStoreCollectByArea(String area) {
    	return areaCountRepository.updateStoreCollectByArea(area);
    }

}